import { activityTableMap, organizationTableMap, organizationMemberMap, microFactsMap, userCommonMap} from './tableMap.ts'
import { selects, options } from './select.ts'

/*
* 形式：heads = [
  {
    value: '社团类型',
    attribute: 'organizationType',
    options: ['娱乐', '竞赛']
  },
  {
    value: '社团名称',
    attribute: 'ACG'
  }
*  
*/

const OrganizationTableHeads = [];

for (const item in organizationTableMap) {
  const obj: IObj = {
    value: item,
    attribute: organizationTableMap[item]
  };

  if (selects.includes(item)) {
    obj.options = options[item];
  }

  OrganizationTableHeads.push(obj);
}

const OrganizationMemberTableHeads = [];

for (const item in organizationMemberMap) {
  const obj: IObj = {
    value: item,
    attribute: organizationMemberMap[item]
  };

  if (selects.includes(item)) {
    obj.options = options[item];
  }

  OrganizationMemberTableHeads.push(obj);
}

const ActivityTableHeads = [];

for (const item in activityTableMap) {
  const obj: IObj = {
    value: item,
    attribute: activityTableMap[item]
  };

  if (selects.includes(item)) {
    obj.options = options[item];
  }

  ActivityTableHeads.push(obj);
}

const UserCommonHeads = [];
for (const item in userCommonMap) {
  const obj: IObj = {
    value: item,
    attribute: userCommonMap[item]
  };

  if (selects.includes(item)) {
    obj.options = options[item];
  }

  UserCommonHeads.push(obj);
}


export { ActivityTableHeads, OrganizationTableHeads, OrganizationMemberTableHeads, UserCommonHeads};
